package com.woniu.p2p.serviceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniu.p2p.entity.Show;
import com.woniu.p2p.mapper.ShowMapper;
import com.woniu.p2p.service.P2PShowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 86152
 * @create 2020/8/7
 * @since 1.0.0
 */
@Service
public class P2PShowServiceImp implements P2PShowService {

    @Autowired
    ShowMapper showMapper;
    @Override
    public PageInfo<Show> findAll(String s, int start, int size) {
        PageHelper.startPage(start,size);
        List<Show> shows = showMapper.selectAll();
        PageInfo<Show> showPageInfo = new PageInfo<>(shows);
        return showPageInfo;
    }

    @Override
    public Show findShowById(Integer showId) {
        return showMapper.selectByPrimaryKey(showId);
    }
}
